package cn.neusoft.luofa603.yuejian_29.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import cn.neusoft.luofa603.yuejian_29.Global;
import cn.neusoft.luofa603.yuejian_29.R;
import cn.neusoft.luofa603.yuejian_29.bean.Union;

public class ActivityInfo extends AppCompatActivity {
    private TextView aname;
    private Button iv_return;
    public  Union union;
    private ImageView ain;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_info);
        innitViews();
        initEvents();
        initData();
    }
    public void innitViews(){
        aname=(TextView) findViewById(R.id.aname);
        iv_return=(Button)findViewById(R.id.iv_return);
        ain=(ImageView)findViewById(R.id.ain);

    }
    public void initEvents(){
        iv_return.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }
    public void initData(){
        getUnion();

    }
    public void getUnion(){
        final Bundle bundle=getIntent().getExtras();
        union=(Union) bundle.getSerializable("Union");
        aname.setText(union.getRec_name());
        Picasso.with(this).load(Global.PIC+union.getThumb()).into(ain);

    }
}
